package com.menhai.personmanagement.controller;

import com.menhai.personmanagement.entity.User;
import com.menhai.personmanagement.mapper.EducationLogMapper;
import com.menhai.personmanagement.plus.OperLog;
import lombok.extern.slf4j.Slf4j;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.menhai.personmanagement.services.IEducationLogService;
import com.menhai.personmanagement.entity.EducationLog;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 * 学历信息 前端控制器
 * </p>
 *
 * @author shikun
 * @since 2021-12-02
 */

@Slf4j
@RestController
@RequestMapping("/educationlog")
public class EducationLogController {

     @Autowired
     private IEducationLogService educationLogService;


    /**
     * @describe 删除医生得学历
     * @param educationLog
     * @Return int
     * @Date 2021/12/6 9:17
     * @author shikun
     */
    @OperLog(operDesc = "删除医生学历",operType = "删除")
     @RequestMapping("/saveDeleteEducationLog")
     public int deleteById(EducationLog educationLog){
          return educationLogService.deleteById(educationLog);
     }


     /**
      * @describe 根据医生id 查询医生学历
      * @param educationLog
      * @Return java.util.List<com.menhai.personmanagement.entity.EducationLog>
      * @Date 2021/12/6 10:12
      * @author shikun
      */
     @RequestMapping("/EducationLogByUserIdList")
     public List<EducationLog> EducationLogByUserIdList (EducationLog educationLog){
      return educationLogService.EducationLogByUserIdList(educationLog);
     }


     /**
      * @describe 根据学历id 查询学历实体
      * @param educationLog
      * @Return java.util.List<com.menhai.personmanagement.entity.EducationLog>
      * @Date 2021/12/6 11:22
      * @author shikun
      */
     @RequestMapping("/selectByeducationid")
     public List<EducationLog> selectByeducationid (EducationLog educationLog){
      return educationLogService.selectByeducationid(educationLog);
     }


     /**
      * @describe  新增医生学历
      * @param educationLog
      * @Return int
      * @Date 2021/12/6 14:27
      * @author shikun
      */
     @OperLog(operDesc = "新增医生学历",operType = "插入")
     @RequestMapping("/inserteducationLog")
     public int inserteducationLog(@RequestBody EducationLog educationLog){

      return educationLogService.inserteducationLog(educationLog);
     }


     /**
      * @describe 修改医生实体
      * @param educationLog
      * @Return int
      * @Date 2021/12/6 14:51
      * @author shikun
      */
     @OperLog(operDesc = "修改医生学历",operType = "修改")
     @RequestMapping("/updateByIdeducationLog")
     public int updateByIdeducationLog(@RequestBody EducationLog educationLog){

      return educationLogService.updateByIdeducationLog(educationLog);
     };

}
